<?php
class User_Model_DefaultModuleToPage extends Zend_Db_Table{
	protected $_name = 'default_module_to_page';
	protected $_primary = array('module_code','page_code');
	/* Link tham khao : http://framework.zend.com/manual/en/zend.db.table.html */
	/* select demo */
	public function selectAllModule($page)
	{// co dung
		$client = new Zend_Rest_Client(HTTP_SERVICE);
		$return = $client->restGet("/defaultmoduletopage/route/selectAllModule/page_code/".$page);
		$return = json_decode(json_encode((array) simplexml_load_string($return->getBody())),1);
		
		for ($i=0;$i <count($return);$i++)
				$data[$i] = $return['row_'.$i];	
		return $data;
	}	
}